# file

# 写
f = open('basic_11_2.txt', 'w')
f.write('hello')
f.write('world')
f.close()
# helloworld

# 读
f = open('basic_11_2.txt', 'r')
s = f.read(4)
print(s, type(s))  # hell <class 'str'>
s = f.read()  # 不指定字符数，则全部读取
print(s, type(s))  # oworld <class 'str'>
